# import requests

# session=requests.Session()

# url = "http://www.testingedu.com.cn:8081/inter/REST/auth"
# # session.headers["token"] = "9f7dda6c146e4a0ba1533f44bb3888f6"
# response=session.post(url)
# result=response.text
# print(result, type(result))
# js1=json.loads(result)
# # print(js1,type(js1))
# # print(js1.get("token"))
# # js = response.json()
# # print(js.get("token"))
# session.headers["token"]= js1.get("token")
# url1 = "http://www.testingedu.com.cn:8081/inter/REST/login/Will/123456"
# r = session.post(url1)
# print(r.text)

# url2="http://www.testingedu.com.cn:8081/inter/REST/login"
# r=session.post(url2)
# print(r.json())
from Keywords.inter_keys import Inter

inter = Inter()
inter.post_data("http://www.testingedu.com.cn:8081/inter/REST/auth")
inter.save_json("token","newtoken")
inter.add_header("token", "{newtoken}")
inter.post_data("http://www.testingedu.com.cn:8081/inter/REST/login/Will/123456")
inter.post_data("http://www.testingedu.com.cn:8081/inter/REST/login")
inter.assertmysql("SELECT * from userinfo where username='will';", "username", "Will")

